<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <p><span>name：</span><span class="span1"></span></p>
    <p><span>name：</span><span class="span2"></span></p>
    <p><button onclick="handleClick(this)">点击我<span class="span3"></span></button></p>
    <script>

        // import()：返回一个Promise对象
        import("./05动态加载export.js").then(obj => {
            document.querySelector(".span1").innerHTML = obj.name;
        });

        import("./05动态加载export.js").then(({name}) => {
            document.querySelector(".span2").innerHTML = name;
        });
        
        let span3 = document.querySelector(".span3");

        let promise = import("./05动态加载export.js");

        function handleClick() {
            promise.then(({increase}) => {
                document.querySelector(".span3").innerHTML = increase();
            });
        }

    </script>
</body>
</html>